import { request } from '@boeyo/portal';

/**
 * 站网查询列表数据
 * @ss.hasPermi('stationsNetworkManage:list')
 */
export const list = (params) => {
  return request({
    url: '/stationsNetworkManage/list',
    method: 'GET',
    params,
  });
};

/**
 * 台站导入
 * @ss.hasPermi('stationsNetworkManage:importBatch')
 */
export const importBatch = (data) => {
  return request({
    url: '/stationsNetworkManage/importBatch',
    method: 'POST',
    data,
  });
};

/**
 * 下载模板
 * null
 */
export const importTemplate = (data?) => {
  return request({
    url: '/stationsNetworkManage/downloadTemplate',
    method: 'POST',
    responseType: 'blob',
    data,
  });
};
/**
 * 导入校验
 * @ss.hasPermi('stationsNetworkManage:import')
 */
export const importData = (data) => {
  return request({
    url: '/stationsNetworkManage/importData',
    method: 'POST',
    data,
  });
};
/**
 * 新增站网信息
 * @ss.hasPermi('stationsNetworkManage:stationsNetworkAdd')
 */
export const stationsNetworkAdd = (params) => {
  return request({
    url: '/stationsNetworkManage/addStationsNetwork',
    method: 'GET',
    params,
  });
};

// 下载设备模板
export const downloadTemplate = async () => {
  return await request({
    url: '/device/downloadTemplate',
    method: 'POST',
    responseType: 'blob',
  });
};

/**
 * 删除站网信息
 * @ss.hasPermi('stationsNetworkManage:stationsNetworkDelete')
 */
export const stationsNetworkDelete = (data) => {
  return request({
    url: `/stationsNetworkManage/delete/${data}`,
    method: 'DELETE',
  });
};

/**
 * 修改站网信息
 * @ss.hasPermi('stationsNetworkManage:stationsNetworkUpdate')
 */
export const stationsNetworkUpdate = (data) => {
  return request({
    url: '/stationsNetworkManage/updateStationsNetwork',
    method: 'PUT',
    data,
  });
};
